<?php

namespace app\admin\validate\scrm;

use think\Validate;

class Client extends Validate
{
    /**
     * 验证规则
     */
    protected $rule = [
        'tel' => 'require|max:40|unique:scrm_client'
    ];
    /**
     * 提示消息
     */
    protected $message = [
    ];
    /**
     * 验证场景
     */
    protected $scene = [
        'add'  => ['tel'],
        'edit'  => ['tel']
    ];
    public function __construct(array $rules = [], $message = [], $field = [])
    {
        $this->field = [
            'tel' => __('Tel'),
        ];
		$id = request()->param("ids");
		if ($id) {
			$rules['tel'] = 'require|max:40|unique:scrm_client,tel,' . $id . ',id';
		}
        parent::__construct($rules, $message, $field);
    }
	
	
	
}
